package org.apache.lucene.ocean;

/**
 * Main configuration object used in the TransactionSystem
 *
 */
public class Config {
  public static final int DEFAULT_MEMORY_INDEX_MAX_DOCS = 50;
  public static final int DEFAULT_MAYBE_MERGE_DOC_CHANGES = 2000;
  public static final int DEFAULT_MAX_RAM_INDEXES_SIZE = 1024 * 1024 * 30;
  public static final float DEFAULT_MERGE_DISK_DELETED_PERCENT = 0.3f;
  public static final float DEFAULT_DELETES_FLUSH_THRESHOLD_PERCENT = 0.3f;
  public static final long DEFAULT_MAYBE_MERGES_TIMER_INTERVAL = 60 * 1000;
  public static final long DEFAULT_LOG_FILE_DELETE_TIMER_INTERVAL = 100 * 1000;
  
  public int serverNumber = 0;
  public int memoryIndexMaxDocs = DEFAULT_MEMORY_INDEX_MAX_DOCS;
  /** Number of docs that have to change, adds + deletes, before
   *  MaybeMergeIndexes is called
   **/
  public int maybeMergeDocChanges = DEFAULT_MAYBE_MERGE_DOC_CHANGES;
  /**
   * Size in bytes all ram indexes after which they are written as a single optimized
   * index to disk. 
   */
  public int maxRamIndexesSize = DEFAULT_MAX_RAM_INDEXES_SIZE;
  public int maxDocsIndexes = -1;
  public int maxSnapshots = 5;
  /**
   * Percentage documents that are deleted in an index before it is available to be 
   * merged
   */
  public float mergeDiskDeletedPercent = DEFAULT_MERGE_DISK_DELETED_PERCENT;
  public long snapshotExpiration = 20 * 1000;
  public float deletesFlushThresholdPercent = DEFAULT_DELETES_FLUSH_THRESHOLD_PERCENT;
  public long maybeMergesTimerInterval = DEFAULT_MAYBE_MERGES_TIMER_INTERVAL;
  public long logFileDeleteTimerInterval = DEFAULT_LOG_FILE_DELETE_TIMER_INTERVAL;
  public int diskIndexRAMDirectoryBufferSize = 1024 * 512;
  
  
}
